/**
 * 2017年5月18日
 */
package cn.edu.bjtu.net;

import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;

/**
 * @author Alex
 *
 */
public class KMessaageHandler extends SimpleChannelHandler {
	
	@Override
	public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
		if(e.getMessage() instanceof String){
			System.out.println(e.getMessage());
		}
		super.messageReceived(ctx, e);
	}
	@Override
	public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
		System.out.println(e);
		super.channelConnected(ctx, e);
	}
}
